﻿@addTagHelper *, WebVella.Erp.Plugins.Core
@addTagHelper *, WebVella.Erp.Web
@addTagHelper *, WebVella.TagHelpers
@using WebVella.Erp.Web.Utils;
@using WebVella.Erp.Api.Models;
@using WebVella.Erp.Web.Models;
@using WebVella.Erp.Plugins.Project.Components;
@using WebVella.TagHelpers.Models;
@{
	var options = (PcProjectWidgetTaskDistribution.PcProjectWidgetTaskDistributionOptions)ViewBag.Options;
	var records = (List<EntityRecord>)ViewBag.Records;
	var gridColumn = new List<WvGridColumnMeta>() {
		new WvGridColumnMeta(){
			Name = "",
			Width = "",
			Label = ""
		},
		new WvGridColumnMeta(){
			Name = "overdue",
			Width = "80px",
			Label = "overdue"
		},
		new WvGridColumnMeta(){
			Name = "today",
			Width = "80px",
			Label = "today"
		},
		new WvGridColumnMeta(){
			Name = "other",
			Width = "80px",
			Label = "other"
		},
	};
}
@if (records.Count > 0)
{
<wv-grid bordered="true" small="true" columns="@gridColumn" has-tfoot="false">
	@foreach (var record in records)
	{
		<wv-grid-row>
			<wv-grid-column>@Html.Raw((string)record["user"])</wv-grid-column>
			<wv-grid-column class="@((int)record["overdue"] > 0 ? "go-bkg-red-light" : "")">@record["overdue"]</wv-grid-column>
			<wv-grid-column class="@((int)record["today"] > 0 ? "go-bkg-orange-light" : "")">@record["today"]</wv-grid-column>
			<wv-grid-column>@record["other"]</wv-grid-column>
		</wv-grid-row>
	}
</wv-grid>
}
else { 
	<div class="alert alert-info">No tasks found in queue</div>
}